Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled SO_REUSEADDR socket option of the ArtNetServer listener #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

olange
Copy link

@olange olange commented Sep 11, 2014

Setting this option allows two applications, or more, to bind to the same socket [1], thus to listen and react to the same DMX Input packets. It only works as long as all of the application also set the SO_REUSEADDR socket option.

I used it successfully to have MadMapper (a projection mapping application written in C, which obviously sets the SO_REUSEADDR socket option) and a Processing application (written in Processing/Java and using an Artnet4j-Elios library patched with this change [2]) reacting to the same DMX Input events, which were sent from a small lightning console via DMX and received as ArtNet datagrams via Enttec's OpenDMX Ethernet box on the computer running the apps.

See also:
[1] http://download.java.net/jdk7/archive/b123/docs/api/java/net/DatagramSocket.html#setReuseAddress(boolean)
[2] https://github.com/olange/artnetP5

This allows two applications, or more, to bind to the same socket, thus
listening and reacting to the same DMX Input packets. It only works as
long as all of the application also set the SO_REUSEADDR socket option.

See also:
http://download.java.net/jdk7/archive/b123/docs/api/java/net/DatagramSoc
ket.html#setReuseAddress(boolean)
@acollign
Copy link
Member

@olange , thanks for your contribution. I'm very sorry for this late response. I'll take a look at your work as soon as possible! @jgastonraoul, I guess you also missed this great news...

@olange
Copy link
Author

olange commented Oct 15, 2014

No problem. Although its a very small change (one line of code to activate this option on the socket), I understand you still need to check for possible regression issues.

I successfully used an ArtNet4j library patched with this fix for a live theater play two weeks ago. About my use case for the theater play: the patch allowed me to consume DMX events sent by a Cameo Control 6 console that was on-stage, simultaneously from MadMapper and from a Processing Diaporama app.

MadMapper is indeed also honoring this SO_REUSEADDR option, which allowed both apps to listen to then same socket and DMX messages.

One cursor (DMX channel 1) of the console did control the master luminosity level of MadMapper's output, and two other cursors (DMX channels 2 and 3) were controlling the Processing animation. Both applications where listening to ArtNet/DMX events over an Enttec ODE.

The processing diaporama app was using the patched ArtNet4j library and was «behind» MadMapper, delivering its frames with the Syphon protocol. Hope this helps... Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants